<?php
	/**
	* Products Brands Get list 
	* return in Json format
	* @author trungdt
	* @since Sep 27, 2011
	*/
	if (!defined('EXPONENT')) exit('');


	$data=$db->selectObjects("productsmodule_brand", "location_data = '".serialize($loc)."'");
    if (isset($_REQUEST['product_edit_load']))
    {
        $temp=null;
        $temp->id=0;
        $temp->text="---";
        //$data=array_unshift($data, $temp);
    }
	foreach ($data as $k=>$v)
	{
		//Get the image file if there is one.
		if (isset($v->logo_id) && ($v->logo_id > 0)) {
			$file = $db->selectObject('file', 'id='.$v->logo_id);
			$v->logo_path = URL_FULL.$file->directory.'/'.$file->filename;
		}
		else
			$v->logo_path="";
	}
	echo json_encode($data);
	die();
?>